﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.ServiceModel.Web;
using System.Text;

// NOTE: You can use the "Rename" command on the "Refactor" menu to change the class name "Service" in code, svc and config file together.
public class Service : IService
{
    public double CalculateTip(double BillTotal, double TipRate, int Persons)
    {
        double rate;
        double dPersons = (double)Persons;
        if (TipRate >= 1)
            rate = TipRate / 100;
        else
            rate = TipRate;

        double result = (BillTotal * rate) / dPersons;



        return result;
    }
}
